﻿#region Header

/*
Remote views based on linq
By

Pascal Hauser 
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

and

Raphael Gfeller
Dipl. Ing. in Informatik, Hochschule für Technik Rapperswil, 2006
Master Thesis, Hochschule für Technik Rapperswil, 2008-2010

*/

#endregion

#region Usings

using System;
using Sebarf.Diagnostics.Interfaces;
using Sebarf.ProcessChains.Interfaces;
using Sebarf.Services.Interfaces;
using Sebastof.Core.Services.Interfaces;

#endregion

namespace Sebastof.Core.Services {
	/// <summary>
	/// Description of the class
	/// </summary>
	public class ClientTransmissionOfObjectService : Service, IObjectTransmissionService {
		#region Public Properties

		[ServiceRequest]
		public IProcessChainExecutorService ProcessChainExecutorService { get; set; }

		[ServiceRequest]
		public IDeserializationSetTargetTypeService DeserializationSetTargetTypeService { get; set; }

		#endregion

		#region IObjectTransmissionService Members

		public object PrepareObjectForTransmission(object obj) {
			throw new NotImplementedException();
		}

		public object PrepareTransmittedObjectForUsing(Type requestedType, object toUndecorage) {
			Check.ArgumentNotNull(DeserializationSetTargetTypeService, "DeserializationSetTargetTypeService");
			DeserializationSetTargetTypeService.SetTargetType(requestedType);
			return ProcessChainExecutorService.Process(toUndecorage);
		}

		#endregion
	}
}